package explorer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import explorer.abstractFactory.BluStyleLoader;
import explorer.abstractFactory.ProxyFactoryLoader;
import explorer.abstractFactory.PurpleStyleLoader;

public class IconMenu extends JMenu{

	private ProxyFactoryLoader proxyFactory;
	
	public IconMenu(final ProxyFactoryLoader proxyFactory) {
	
		super("View");
//		this.proxyFactory=proxyFactory;
		
		JMenuItem iconsBlue= new JMenuItem("Blue Icons");
		iconsBlue.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				proxyFactory.setFactory(new BluStyleLoader());
				
			}
		});	
		add(iconsBlue);
		
		JMenuItem iconsPurple= new JMenuItem("Purple Icons");
		iconsPurple.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				proxyFactory.setFactory(new PurpleStyleLoader());
				
			}
		});
		add(iconsPurple);
		
		
	}
}